home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
v8n13.arc
/
SUBST.BAS
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
BASIC Source File
|
1989-06-10
|
355 b
|
14 lines
SUB SUBST (old$, new$, text$, start)
gap = LEN(old$)
n = LEN(text$)
IF start <= n THEN
x = INSTR(start, text$, old$)
DO WHILE x > 0
text$ = LEFT$(text$, x - 1) + new$ +_
RIGHT$(text$, n + 1 -(x + gap))
n = LEN(text$)
x = INSTR(x, text$, old$)
LOOP
END IF
END SUB